package jpa.entitys.promis.common;

import java.io.Serializable;

import javax.persistence.*;

import java.math.BigDecimal;
import java.util.Date;


/**
 * The persistent class for the INVOICE_DETAILS database table.
 * 
 */
@Entity
@Table(name="INVOICE_DETAILS")
@NamedQueries({
    @NamedQuery(name = "InvoiceDetail.findAll", query = " SELECT c FROM InvoiceDetail c "),
    @NamedQuery(name = "InvoiceDetail.findById", query = " SELECT c FROM InvoiceDetail c WHERE c.id = :Id "),
    @NamedQuery(name = "InvoiceDetail.findByStatus", query = " SELECT c FROM InvoiceDetail c WHERE c.syncIssync = 'N'"),
})
public class InvoiceDetail extends jpa.entitys.common.CommonEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private InvoiceDetailPK id;
	
	@Override public String toString() { return org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(this);}

	@Column(name="ADDRESS_CODE", precision=2)
	private BigDecimal addressCode;

	@Column(precision=16, scale=2)
	private BigDecimal amount;

	@Column(name="BILLING_CODE", length=30)
	private String billingCode;

	@Column(name="BUILDING_PHASE_CODE", length=30)
	private String buildingPhaseCode;

	@Column(name="CHARGE_CODE", length=2)
	private String chargeCode;

	@Column(name="CONTRACT_NO", precision=6)
	private BigDecimal contractNo;

	@Column(name="CONTRACT_SEQ", precision=6)
	private BigDecimal contractSeq;

	@Column(name="CONTRACT_SERIES", length=4)
	private String contractSeries;

	@Column(name="CREATED_BY")
	private String createdBy;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="CREATED_ON")
	private Date createdOn;

	@Column(name="CUM_CRNOTE_NET_VALUE", precision=16, scale=2)
	private BigDecimal cumCrnoteNetValue;

	@Column(name="CUM_CRNOTE_VAT_VALUE", precision=16, scale=2)
	private BigDecimal cumCrnoteVatValue;

	@Column(name="CUSTOMER_CODE", length=30)
	private String customerCode;

	@Column(name="DISCOUNT_AMOUNT", precision=16, scale=2)
	private BigDecimal discountAmount;

	@Column(name="DO_NO", precision=6)
	private BigDecimal doNo;

	@Column(name="DO_SERIES", length=4)
	private String doSeries;

	@Column(name="DO_TYPE", length=2)
	private String doType;

	@Column(name="DOC_REF", length=150)
	private String docRef;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="FROM_DATE")
	private Date fromDate;

	@Column(name="GEN_NUMBER", precision=6)
	private BigDecimal genNumber;

	@Column(name="GEN_PEN_NUMBER", precision=6)
	private BigDecimal genPenNumber;

	@Column(name="GEN_PEN_SERIES", length=4)
	private String genPenSeries;

	@Column(name="GEN_PEN_TYPE", length=2)
	private String genPenType;

	@Column(name="GEN_PENALTY_FLAG", length=2)
	private String genPenaltyFlag;

	@Column(name="GEN_SERIES", length=4)
	private String genSeries;

	@Column(name="GEN_TYPE", length=2)
	private String genType;

	@Column(name="INCLUDED_VAT_FLAG", length=1)
	private String includedVatFlag;

	@Column(name="INV_OPPRID_SAPB1", precision=22)
	private BigDecimal invOppridSapb1;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="INVOICE_DATE")
	private Date invoiceDate;

	@Column(name="LAST_UPD_BY")
	private String lastUpdBy;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="LAST_UPD_ON")
	private Date lastUpdOn;

	@Column(name="METER_NUMBER")
	private String meterNumber;

	@Column(name="METER_TYPE", length=2)
	private String meterType;

	@Column(name="NET_INVOICE", precision=16, scale=2)
	private BigDecimal netInvoice;

	@Column(name="PAYMENT_RECEIVED", precision=16, scale=2)
	private BigDecimal paymentReceived;

	@Column(name="PAYMENT_RECEIVED_TMP", precision=22)
	private BigDecimal paymentReceivedTmp;

	@Column(name="PRICE_PER_UNIT", precision=16, scale=2)
	private BigDecimal pricePerUnit;

	@Column(length=30)
	private String project;

	@Column(name="PROPERTY_TYPE_CODE", length=30)
	private String propertyTypeCode;

	@Column(name="REF_INVOICE_NO", precision=6)
	private BigDecimal refInvoiceNo;

	@Column(name="REF_INVOICE_SEQ_NO", precision=6)
	private BigDecimal refInvoiceSeqNo;

	@Column(name="REF_INVOICE_SERIES", length=4)
	private String refInvoiceSeries;

	@Column(name="REF_INVOICE_TYPE", length=2)
	private String refInvoiceType;

	@Column(length=300)
	private String remarks;

	@Column(name="REVISION_NUMBER", length=3)
	private String revisionNumber;

	@Column(name="SBO_ENTRY", precision=22)
	private BigDecimal sboEntry;

	@Column(name="SBO_INVOICE", precision=22)
	private BigDecimal sboInvoice;

	@Column(name="SEQ_NO", precision=6)
	private BigDecimal seqNo;

	@Column(name="SERVICE_VAT_FLAG", length=1)
	private String serviceVatFlag;

	@Column(length=1)
	private String status;

	@Column(name="SYNC_CREATEDBY", length=100)
	private String syncCreatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_CREATEDON")
	private Date syncCreatedon;

	@Column(name="SYNC_EXTERNAL_REF_KEY", length=100)
	private String syncExternalRefKey;

	@Column(name="SYNC_EXTERNAL_REF_NO", length=100)
	private String syncExternalRefNo;

	@Column(name="SYNC_ISSTAGING", length=1)
	private String syncIsstaging;

	@Column(name="SYNC_ISSYNC", length=1)
	private String syncIssync;

	@Column(name="SYNC_UPDATEDBY", length=100)
	private String syncUpdatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_UPDATEDON")
	private Date syncUpdatedon;

	@Column(name="TAX_TYPE_CODE", length=2)
	private String taxTypeCode;

	@Column(name="TEMP_ADVANCE_RECEIVED", precision=16, scale=2)
	private BigDecimal tempAdvanceReceived;

	@Column(name="TEMP_AMOUNT_BF_VAT", precision=16, scale=2)
	private BigDecimal tempAmountBfVat;

	@Column(name="TEMP_PAYMENT_RECEIVED", precision=16, scale=2)
	private BigDecimal tempPaymentReceived;

	@Column(name="TEMP_VAT_RECEIVED", precision=16, scale=2)
	private BigDecimal tempVatReceived;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="TO_DATE")
	private Date toDate;

	@Column(name="TRANSFER_B1_LOG", length=1)
	private String transferB1Log;

	@Column(name="TYPE_OF_CONTRACT", length=2)
	private String typeOfContract;

	@Column(name="UNIT_NUMBER", length=30)
	private String unitNumber;

	@Column(precision=16, scale=2)
	private BigDecimal units;

	@Column(name="VAT_AMOUNT", precision=12, scale=2)
	private BigDecimal vatAmount;

	@Column(name="VAT_CODE", length=2)
	private String vatCode;

	@Column(name="VAT_PERCENT", precision=5, scale=2)
	private BigDecimal vatPercent;

	@Column(name="VAT_RECEIVED", precision=16, scale=2)
	private BigDecimal vatReceived;

	@Column(name="WHT_AMOUNT", precision=16, scale=2)
	private BigDecimal whtAmount;

	@Column(name="WHT_CODE", length=2)
	private String whtCode;

	@Column(name="WHT_PERCENT", precision=5, scale=2)
	private BigDecimal whtPercent;

	//bi-directional many-to-one association to Invoice
    @ManyToOne
	@JoinColumns({
		@JoinColumn(name="COMPANY", referencedColumnName="COMPANY", nullable=false, insertable=false, updatable=false),
		@JoinColumn(name="INVOICE_NO", referencedColumnName="INVOICE_NO", nullable=false, insertable=false, updatable=false),
		@JoinColumn(name="INVOICE_SERIES", referencedColumnName="INVOICE_SERIES", nullable=false, insertable=false, updatable=false),
		@JoinColumn(name="INVOICE_TYPE", referencedColumnName="INVOICE_TYPE", nullable=false, insertable=false, updatable=false)
		})
	private Invoice invoice;

    public InvoiceDetail() {
    }

	public InvoiceDetailPK getId() {
		return this.id;
	}

	public void setId(InvoiceDetailPK id) {
		this.id = id;
	}
	
	public BigDecimal getAddressCode() {
		return this.addressCode;
	}

	public void setAddressCode(BigDecimal addressCode) {
		this.addressCode = addressCode;
	}

	public BigDecimal getAmount() {
		return this.amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public String getBillingCode() {
		return this.billingCode;
	}

	public void setBillingCode(String billingCode) {
		this.billingCode = billingCode;
	}

	public String getBuildingPhaseCode() {
		return this.buildingPhaseCode;
	}

	public void setBuildingPhaseCode(String buildingPhaseCode) {
		this.buildingPhaseCode = buildingPhaseCode;
	}

	public String getChargeCode() {
		return this.chargeCode;
	}

	public void setChargeCode(String chargeCode) {
		this.chargeCode = chargeCode;
	}

	public BigDecimal getContractNo() {
		return this.contractNo;
	}

	public void setContractNo(BigDecimal contractNo) {
		this.contractNo = contractNo;
	}

	public BigDecimal getContractSeq() {
		return this.contractSeq;
	}

	public void setContractSeq(BigDecimal contractSeq) {
		this.contractSeq = contractSeq;
	}

	public String getContractSeries() {
		return this.contractSeries;
	}

	public void setContractSeries(String contractSeries) {
		this.contractSeries = contractSeries;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	public BigDecimal getCumCrnoteNetValue() {
		return this.cumCrnoteNetValue;
	}

	public void setCumCrnoteNetValue(BigDecimal cumCrnoteNetValue) {
		this.cumCrnoteNetValue = cumCrnoteNetValue;
	}

	public BigDecimal getCumCrnoteVatValue() {
		return this.cumCrnoteVatValue;
	}

	public void setCumCrnoteVatValue(BigDecimal cumCrnoteVatValue) {
		this.cumCrnoteVatValue = cumCrnoteVatValue;
	}

	public String getCustomerCode() {
		return this.customerCode;
	}

	public void setCustomerCode(String customerCode) {
		this.customerCode = customerCode;
	}

	public BigDecimal getDiscountAmount() {
		return this.discountAmount;
	}

	public void setDiscountAmount(BigDecimal discountAmount) {
		this.discountAmount = discountAmount;
	}

	public BigDecimal getDoNo() {
		return this.doNo;
	}

	public void setDoNo(BigDecimal doNo) {
		this.doNo = doNo;
	}

	public String getDoSeries() {
		return this.doSeries;
	}

	public void setDoSeries(String doSeries) {
		this.doSeries = doSeries;
	}

	public String getDoType() {
		return this.doType;
	}

	public void setDoType(String doType) {
		this.doType = doType;
	}

	public String getDocRef() {
		return this.docRef;
	}

	public void setDocRef(String docRef) {
		this.docRef = docRef;
	}

	public Date getFromDate() {
		return this.fromDate;
	}

	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}

	public BigDecimal getGenNumber() {
		return this.genNumber;
	}

	public void setGenNumber(BigDecimal genNumber) {
		this.genNumber = genNumber;
	}

	public BigDecimal getGenPenNumber() {
		return this.genPenNumber;
	}

	public void setGenPenNumber(BigDecimal genPenNumber) {
		this.genPenNumber = genPenNumber;
	}

	public String getGenPenSeries() {
		return this.genPenSeries;
	}

	public void setGenPenSeries(String genPenSeries) {
		this.genPenSeries = genPenSeries;
	}

	public String getGenPenType() {
		return this.genPenType;
	}

	public void setGenPenType(String genPenType) {
		this.genPenType = genPenType;
	}

	public String getGenPenaltyFlag() {
		return this.genPenaltyFlag;
	}

	public void setGenPenaltyFlag(String genPenaltyFlag) {
		this.genPenaltyFlag = genPenaltyFlag;
	}

	public String getGenSeries() {
		return this.genSeries;
	}

	public void setGenSeries(String genSeries) {
		this.genSeries = genSeries;
	}

	public String getGenType() {
		return this.genType;
	}

	public void setGenType(String genType) {
		this.genType = genType;
	}

	public String getIncludedVatFlag() {
		return this.includedVatFlag;
	}

	public void setIncludedVatFlag(String includedVatFlag) {
		this.includedVatFlag = includedVatFlag;
	}

	public BigDecimal getInvOppridSapb1() {
		return this.invOppridSapb1;
	}

	public void setInvOppridSapb1(BigDecimal invOppridSapb1) {
		this.invOppridSapb1 = invOppridSapb1;
	}

	public Date getInvoiceDate() {
		return this.invoiceDate;
	}

	public void setInvoiceDate(Date invoiceDate) {
		this.invoiceDate = invoiceDate;
	}

	public String getLastUpdBy() {
		return this.lastUpdBy;
	}

	public void setLastUpdBy(String lastUpdBy) {
		this.lastUpdBy = lastUpdBy;
	}

	public Date getLastUpdOn() {
		return this.lastUpdOn;
	}

	public void setLastUpdOn(Date lastUpdOn) {
		this.lastUpdOn = lastUpdOn;
	}

	public String getMeterNumber() {
		return this.meterNumber;
	}

	public void setMeterNumber(String meterNumber) {
		this.meterNumber = meterNumber;
	}

	public String getMeterType() {
		return this.meterType;
	}

	public void setMeterType(String meterType) {
		this.meterType = meterType;
	}

	public BigDecimal getNetInvoice() {
		return this.netInvoice;
	}

	public void setNetInvoice(BigDecimal netInvoice) {
		this.netInvoice = netInvoice;
	}

	public BigDecimal getPaymentReceived() {
		return this.paymentReceived;
	}

	public void setPaymentReceived(BigDecimal paymentReceived) {
		this.paymentReceived = paymentReceived;
	}

	public BigDecimal getPaymentReceivedTmp() {
		return this.paymentReceivedTmp;
	}

	public void setPaymentReceivedTmp(BigDecimal paymentReceivedTmp) {
		this.paymentReceivedTmp = paymentReceivedTmp;
	}

	public BigDecimal getPricePerUnit() {
		return this.pricePerUnit;
	}

	public void setPricePerUnit(BigDecimal pricePerUnit) {
		this.pricePerUnit = pricePerUnit;
	}

	public String getProject() {
		return this.project;
	}

	public void setProject(String project) {
		this.project = project;
	}

	public String getPropertyTypeCode() {
		return this.propertyTypeCode;
	}

	public void setPropertyTypeCode(String propertyTypeCode) {
		this.propertyTypeCode = propertyTypeCode;
	}

	public BigDecimal getRefInvoiceNo() {
		return this.refInvoiceNo;
	}

	public void setRefInvoiceNo(BigDecimal refInvoiceNo) {
		this.refInvoiceNo = refInvoiceNo;
	}

	public BigDecimal getRefInvoiceSeqNo() {
		return this.refInvoiceSeqNo;
	}

	public void setRefInvoiceSeqNo(BigDecimal refInvoiceSeqNo) {
		this.refInvoiceSeqNo = refInvoiceSeqNo;
	}

	public String getRefInvoiceSeries() {
		return this.refInvoiceSeries;
	}

	public void setRefInvoiceSeries(String refInvoiceSeries) {
		this.refInvoiceSeries = refInvoiceSeries;
	}

	public String getRefInvoiceType() {
		return this.refInvoiceType;
	}

	public void setRefInvoiceType(String refInvoiceType) {
		this.refInvoiceType = refInvoiceType;
	}

	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getRevisionNumber() {
		return this.revisionNumber;
	}

	public void setRevisionNumber(String revisionNumber) {
		this.revisionNumber = revisionNumber;
	}

	public BigDecimal getSboEntry() {
		return this.sboEntry;
	}

	public void setSboEntry(BigDecimal sboEntry) {
		this.sboEntry = sboEntry;
	}

	public BigDecimal getSboInvoice() {
		return this.sboInvoice;
	}

	public void setSboInvoice(BigDecimal sboInvoice) {
		this.sboInvoice = sboInvoice;
	}

	public BigDecimal getSeqNo() {
		return this.seqNo;
	}

	public void setSeqNo(BigDecimal seqNo) {
		this.seqNo = seqNo;
	}

	public String getServiceVatFlag() {
		return this.serviceVatFlag;
	}

	public void setServiceVatFlag(String serviceVatFlag) {
		this.serviceVatFlag = serviceVatFlag;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getSyncCreatedby() {
		return this.syncCreatedby;
	}

	public void setSyncCreatedby(String syncCreatedby) {
		this.syncCreatedby = syncCreatedby;
	}

	public Date getSyncCreatedon() {
		return this.syncCreatedon;
	}

	public void setSyncCreatedon(Date syncCreatedon) {
		this.syncCreatedon = syncCreatedon;
	}

	public String getSyncExternalRefKey() {
		return this.syncExternalRefKey;
	}

	public void setSyncExternalRefKey(String syncExternalRefKey) {
		this.syncExternalRefKey = syncExternalRefKey;
	}

	public String getSyncExternalRefNo() {
		return this.syncExternalRefNo;
	}

	public void setSyncExternalRefNo(String syncExternalRefNo) {
		this.syncExternalRefNo = syncExternalRefNo;
	}

	public String getSyncIsstaging() {
		return this.syncIsstaging;
	}

	public void setSyncIsstaging(String syncIsstaging) {
		this.syncIsstaging = syncIsstaging;
	}

	public String getSyncIssync() {
		return this.syncIssync;
	}

	public void setSyncIssync(String syncIssync) {
		this.syncIssync = syncIssync;
	}

	public String getSyncUpdatedby() {
		return this.syncUpdatedby;
	}

	public void setSyncUpdatedby(String syncUpdatedby) {
		this.syncUpdatedby = syncUpdatedby;
	}

	public Date getSyncUpdatedon() {
		return this.syncUpdatedon;
	}

	public void setSyncUpdatedon(Date syncUpdatedon) {
		this.syncUpdatedon = syncUpdatedon;
	}

	public String getTaxTypeCode() {
		return this.taxTypeCode;
	}

	public void setTaxTypeCode(String taxTypeCode) {
		this.taxTypeCode = taxTypeCode;
	}

	public BigDecimal getTempAdvanceReceived() {
		return this.tempAdvanceReceived;
	}

	public void setTempAdvanceReceived(BigDecimal tempAdvanceReceived) {
		this.tempAdvanceReceived = tempAdvanceReceived;
	}

	public BigDecimal getTempAmountBfVat() {
		return this.tempAmountBfVat;
	}

	public void setTempAmountBfVat(BigDecimal tempAmountBfVat) {
		this.tempAmountBfVat = tempAmountBfVat;
	}

	public BigDecimal getTempPaymentReceived() {
		return this.tempPaymentReceived;
	}

	public void setTempPaymentReceived(BigDecimal tempPaymentReceived) {
		this.tempPaymentReceived = tempPaymentReceived;
	}

	public BigDecimal getTempVatReceived() {
		return this.tempVatReceived;
	}

	public void setTempVatReceived(BigDecimal tempVatReceived) {
		this.tempVatReceived = tempVatReceived;
	}

	public Date getToDate() {
		return this.toDate;
	}

	public void setToDate(Date toDate) {
		this.toDate = toDate;
	}

	public String getTransferB1Log() {
		return this.transferB1Log;
	}

	public void setTransferB1Log(String transferB1Log) {
		this.transferB1Log = transferB1Log;
	}

	public String getTypeOfContract() {
		return this.typeOfContract;
	}

	public void setTypeOfContract(String typeOfContract) {
		this.typeOfContract = typeOfContract;
	}

	public String getUnitNumber() {
		return this.unitNumber;
	}

	public void setUnitNumber(String unitNumber) {
		this.unitNumber = unitNumber;
	}

	public BigDecimal getUnits() {
		return this.units;
	}

	public void setUnits(BigDecimal units) {
		this.units = units;
	}

	public BigDecimal getVatAmount() {
		return this.vatAmount;
	}

	public void setVatAmount(BigDecimal vatAmount) {
		this.vatAmount = vatAmount;
	}

	public String getVatCode() {
		return this.vatCode;
	}

	public void setVatCode(String vatCode) {
		this.vatCode = vatCode;
	}

	public BigDecimal getVatPercent() {
		return this.vatPercent;
	}

	public void setVatPercent(BigDecimal vatPercent) {
		this.vatPercent = vatPercent;
	}

	public BigDecimal getVatReceived() {
		return this.vatReceived;
	}

	public void setVatReceived(BigDecimal vatReceived) {
		this.vatReceived = vatReceived;
	}

	public BigDecimal getWhtAmount() {
		return this.whtAmount;
	}

	public void setWhtAmount(BigDecimal whtAmount) {
		this.whtAmount = whtAmount;
	}

	public String getWhtCode() {
		return this.whtCode;
	}

	public void setWhtCode(String whtCode) {
		this.whtCode = whtCode;
	}

	public BigDecimal getWhtPercent() {
		return this.whtPercent;
	}

	public void setWhtPercent(BigDecimal whtPercent) {
		this.whtPercent = whtPercent;
	}

	public Invoice getInvoice() {
		return this.invoice;
	}

	public void setInvoice(Invoice invoice) {
		this.invoice = invoice;
	}
	
}